Skip to content

fix: allways allow duplicaiton - #8689

Open
SebastianKrupinski wants to merge 1 commit into
mainfrom
fix/always-allow-duplication
Open

fix: allways allow duplicaiton#8689
SebastianKrupinski wants to merge 1 commit into
mainfrom
fix/always-allow-duplication

Conversation

@SebastianKrupinski

@SebastianKrupinski SebastianKrupinski commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolves: Allow to copy events #8608
  • Removed the isReadOnly (User should be able to duplicate any event, this is no different then exporting then importing)
  • Removed the canCreateRecurrenceException (This is used to control changing recurring events, so it makes no sense on duplication)
  • Fixed broken copy logic in copyCalendarObjectInstanceIntoEventComponent

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mixins/EditorMixin.js 0.00% 3 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/views/EditSimple.vue
Comment thread src/views/EditFull.vue
Comment thread src/views/EditFull.vue
@odzhychko odzhychko added Feature: Editor enhancement New feature request labels Aug 6, 2026
@odzhychko

Copy link
Copy Markdown
Contributor

Found #8421 that implements duplication for read-only events.

@SebastianKrupinski
SebastianKrupinski force-pushed the fix/always-allow-duplication branch 2 times, most recently from 109d443 to 8e27ba0 Compare August 10, 2026 16:53
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>

@odzhychko odzhychko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying now works as expected.
And thx for fixing what I broke in #8606 🤦

In some case the duplicate action is displayed event though duplication is not possible.

Comment thread src/mixins/EditorMixin.js
@@ -646,7 +646,7 @@ export default {
keyboardDuplicateEvent(event) {
if (event.key === 'd' && event.ctrlKey === true) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note(non-blocking): Shortcuts do not work as expect under MacOS

We should use https://nextcloud-vue-components.netlify.app/#/Composables/useHotKey

Created #8715

Comment thread src/mixins/EditorMixin.js
if (event.key === 'd' && event.ctrlKey === true) {
event.preventDefault()
if (!this.isNew && !this.isReadOnly && !this.canCreateRecurrenceException) {
if (!this.isNew && !this.canCreateRecurrenceException) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Inconsistent/outdated check for !this.canCreateRecurrenceException.

Overview of current checks:

  • EditorMixin.keyboardDuplicateEvent: !this.isNew && !this.canCreateRecurrenceException
  • EditFull.vue: !isNew (checked on action)
  • EditSimple.vue: !isNew (checked on action container)

Might worth introducing EditorMixin.canDuplicate to avoid accidental drift.

Comment thread src/views/EditFull.vue
{{ $t('calendar', 'Export') }}
</NcActionLink>
<NcActionButton v-if="!canCreateRecurrenceException && !isReadOnly && !isNew" @click="duplicateEvent()">
<NcActionButton v-if="!isNew" @click="duplicateEvent()">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Duplicate action is available in embedded view (apps/calendar/embed/...) and has no effect.

Comment thread src/views/EditFull.vue
{{ $t('calendar', 'Export') }}
</NcActionLink>
<NcActionButton v-if="!canCreateRecurrenceException && !isReadOnly && !isNew" @click="duplicateEvent()">
<NcActionButton v-if="!isNew" @click="duplicateEvent()">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Duplicate action is available in public view (/apps/calendar/p/...) and has no effect.

Comment thread src/mixins/EditorMixin.js
const calendarId = this.isReadOnly
? (this.calendarsStore.sortedCalendars[0]?.id ?? null)
: (this.calendarObject?.calendarId ?? null)
await this.calendarObjectInstanceStore.duplicateCalendarObjectInstance({ calendarId })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: We should abort (with a warning), if calendarId === null aka. no writable target calendar exists.

Or maybe even dont show that duplicate action to the user, if no writable target calendar exists.

Could be part ofEditorMixin.canDuplicate (suggested in https://github.com/nextcloud/calendar/pull/8689/changes#r3754176914)

Such a check would automatically resolve:

timezoneId: oldEventComponent.startDate.timezoneId,
isAllDay: oldEventComponent.isAllDay(),
calendarId: this.calendarObject?.calendarId ?? null,
calendarId: calendarId ?? this.calendarObject?.calendarId ?? null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this.calendarObject?.calendarId might be of a read only calendar. Let's make calendarId mandatory.

Relates to https://github.com/nextcloud/calendar/pull/8689/changes#r3754267389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature request Feature: Editor

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

Allow to copy events

2 participants